/******************************************************************************
 copyright (C), 2018, hisilicon tech. co., ltd.
******************************************************************************
file name     : gdc_drv_comm.h
version       : initial draft
author        : hisilicon multimedia software group
created       : 2018/9/17
last modified :
description   :
function list :
******************************************************************************/


#ifndef __PM_DRV_COMM_H__
#define __PM_DRV_COMM_H__
#include "hi_osal.h"



#ifdef __PM_DEBUG_ON__

#define PM_DEBUG(fmt,...)  osal_printk( "[info]:"fmt,##__VA_ARGS__)

#else

#define PM_DEBUG(format,...)

#endif


typedef enum {
    HI_CPU_AVS_POLICY_CLOSE = 0,         /**<avs not used */
    HI_CPU_AVS_POLICY_HPM,                  /**<use the hpm table*/
    HI_CPU_AVS_POLICY_ONLY_TEMP,      /**only temperature used */
    HI_CPU_AVS_POLICY_BUTT

} hi_cpu_avs_policy;


typedef enum {
    HI_CPU_DVFS_POLICY_CLOSE = 0,          /**<DVFS  not used */
    HI_CPU_DVFS_POLICY_OPEN,                  /**<dvfs used */
    HI_CPU_DVFS_POLICY_BUTT

} hi_cpu_dvfs_policy;


typedef enum {
    HI_MEDIA_AVS_POLICY_CLOSE = 0,        /**<avs not used */
    HI_MEDIA_AVS_POLICY_HPM,                  /**<use the hpm table */
    HI_MEDIA_AVS_POLICY_ONLY_TEMP,      /**only temperature used */
    HI_MEDIA_AVS_POLICY_BUTT

} hi_media_avs_policy;


typedef enum {
    HI_CORE_AVS_POLICY_CLOSE = 0,        /**<avs not used */
    HI_CORE_AVS_POLICY_HPM,                  /**<use the hpm table */
    HI_CORE_AVS_POLICY_ONLY_TEMP,      /**only temperature used */
    HI_CORE_AVS_POLICY_BUTT

} hi_core_avs_policy;


typedef enum {
    HI_PM_MISC_POLICY_NONE = 0,            /**<no misc policy*/
    HI_PM_MISC_POLICY_SVPCTRL = 1,        /**<ctrl svp enable or disable */
    HI_PM_MISC_POLICY_BUTT

} hi_pm_misc_policy;


/* policy get interface */

int hal_cpu_get_avs_policy(void);

int hal_media_get_avs_policy(void);

int hal_core_get_avs_policy(void);

int hal_cpu_get_dvfs_policy(void);

/*tsensor  interface */

void pm_hal_tsensor_init(void);

int pm_hal_get_temperature(void);


#endif /* end of #ifndef __PM_DRV_COMM_H__ */



